import { Excel } from '@ttou/midway-excel'
import { Exclude } from 'class-transformer'

import { SysPostEntity, SysUserEntity } from '@/entity'

/** 岗位导出序列化 */
export class PostExportSerialize implements SysPostEntity {
  @Excel({ header: '岗位编号' })
  postId: string

  @Excel({ header: '岗位编码' })
  postCode: string

  @Excel({ header: '岗位名称' })
  postName: string

  @Excel({ header: '显示顺序' })
  postSort: number

  @Excel({ header: '状态' })
  status: string

  @Excel({ header: '创建者' })
  createBy: string

  @Excel({ header: '创建时间' })
  createTime: Date

  @Excel({ header: '更新者' })
  updateBy: string

  @Excel({ header: '更新时间' })
  updateTime: Date

  @Excel({ header: '备注' })
  remark: string

  @Exclude()
  users: SysUserEntity[]

  constructor(partial: any) {
    Object.assign(this, partial)
  }
}
